﻿@{
}
@model List<DataAccess.Models.SysConfig>
@section Styles{
    @*<link href="~/Content/css/dataTables.bootstrap.css" rel="stylesheet" />
    <link href="~/Content/css/bootstrap-table.min.css" rel="stylesheet" />
    <link href="~/Content/css/dataTables.bootstrap.css" rel="stylesheet" />*@
    @*<link href="~/Scripts/plugins/layer/skin/layer.css" rel="stylesheet" />*@
    @*<link href="~/Scripts/plugins/layer/skin/layer.ext.css" rel="stylesheet" />*@
}
@section Scripts{
    <script src="~/Scripts/plugins/bootstrap.min.js"></script>
    <script src="~/Scripts/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="~/Scripts/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>

    <script type="text/javascript">

        function initAcTable() {
            $('#acc_tb').bootstrapTable('destroy');
            common.initAcTable("acc_tb", "toolbar", "post", "getSysConfigs.html",
                function (data) {
                    if (!data.State) {
                        common.msg(data.Message, 1);
                    }
                },
                function (e) { },
                true, true, false, 10, 1, "[10,20,30,50]", { keyword: $("#keyword").val(), state: $("#state").val() });
        }

        $(document).ready(function () {

            initAcTable();

            $("#btnAdd").click(function () {
                //iframe层

                window.location.href = '/editSysConfig.html';
                //layer.open({
                //    type: 2,
                //    title: '新增账号',
                //    shadeClose: false,
                //    shade: 0.8,
                //    area: ['60%', '40%'],
                //    content: '/editSysConfig.html'
                //});
            });

            $("#search").bind("click", function () {
                var load_index3 = layer.load(0, { shade: 0.6 });
                initAcTable();
                layer.close(load_index3);
            });
 
            $("#state").change(function () {
                var load_index2 = layer.load(0, { shade: 0.6 });
                initAcTable();
                layer.close(load_index2);
            });
        });

        function add_dataFormatter(index, row) {
            var birthdayMilliseconds = parseInt(row.add_data.replace(/\/Date\(/igm, ""));
            var date = new Date(birthdayMilliseconds);
            return date.toLocaleDateString() + " " + date.toLocaleTimeString();
        }
        function synchroFormatter(index, row) {
            var birthdayMilliseconds = parseInt(row.synchro.replace(/\/Date\(/igm, ""));
            var date = new Date(birthdayMilliseconds);
            return date.toLocaleDateString() + " " + date.toLocaleTimeString();
        }
        function stateFormatter(index, row) {
            return row.state == 1 ? "<span name='state_" + row.id + "'>启用</span>" : "<span style='color:red;' name='state_" + row.id + "'>禁用</span>";
        }

        function operateFormatter(index, row) {
            //编辑
            var html = "<a class=\"table-link\" name='opera_" + row.id + "' href=\"javascript:Edit(" + row.id + ")\"><span class=\"fa-stack\"><i class=\"fa fa-square fa-stack-2x\"></i><i class=\"fa fa-pencil fa-stack-1x fa-inverse\"></i></span></a>";
            return html;
        }
  
        var parengPanel;

   
                                   
                                 
        function Edit(id) {
            //iframe层
            window.location.href = '/editSysConfig.html?id=' + id;
            //parengPanel = layer.open({
            //    type: 2,
            //    title: '编辑账号',
            //    shadeClose: false,
            //    shade: 0.8,
            //    area: ['60%', '40%'],
            //    content: '/editSysConfig.html?id=' + id
            //});
        }

    </script>
}
@*<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>站点列表</h5>
                </div>
                <div class="ibox-content">
                    <div class="row" id="toolbar">
                        <div class="col-sm-1">
                           
                        </div>
                        <div class="col-sm-2">
                        </div>
                        <div class="col-sm-2">
                            <div class="input-group">
                                <span class="input-group-btn">
                                    <input type="text" placeholder="搜索账号" class="input-s form-control" id="keyword" name="keyword">
                                    <button type="button" class="btn btn-s btn-primary" id="search">搜索</button>
                                </span>
                            </div>
                        </div>
                        <div class="col-sm-2">
                        </div> 
                    </div>
                    <table data-toggle="table" id="acc_tb" data-pagination="true">
                        <thead>
                            <tr>
                                <th data-field="name" data-align="center">站点名称</th>
                                <th data-field="domain" data-align="center">域名</th>  
                                <th data-field="add_data" data-align="center" data-formatter="add_dataFormatter">添加时间</th>
                                <th data-align="center" data-formatter="operateFormatter">操作</th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>*@

    <div class="row" style="opacity: 1;">
        <div class="col-lg-12">
            <div class="row">
                <div class="col-lg-12">
                    <ol class="breadcrumb">
                        <li><a href="#">Home</a></li>
                        <li class="active"><span>站点列表</span></li>
                    </ol>
                    <div class="clearfix">
                        <h1 class="pull-left">站点列表</h1>
                        <div class="pull-right top-page-ui">
                            <a href="#" class="btn btn-primary pull-right">
                                @*<button type="button" class="btn btn-w-m btn-primary" id="btnAdd">新增</button>*@
                                <i class="fa fa-plus-circle fa-lg" id="btnAdd"></i> 新增
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="main-box no-header clearfix">
                        <div class="main-box-body clearfix">
                            <div class="table-responsive">
                                <table class="table user-list table-hover" id="acc_tb">
                                    <thead>
                                        <tr>
                                            <th data-field="name" data-align="center">站点名称</th>
                                            <th data-field="domain" data-align="center">域名</th>
                                            <th data-field="add_data" data-align="center" data-formatter="add_dataFormatter">添加时间</th>
                                            <th data-align="center" data-formatter="operateFormatter">操作</th>
                                        </tr>
                                    </thead>



                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <footer id="footer-bar" class="row" style="opacity: 1;">
        <p id="footer-copyright" class="col-xs-12">
            Powered by PRISM Theme.
        </p>
    </footer>
